<%= render :partial => 'spree/admin/shared/configuration_menu' %>
<h3> Notifications </h3>
<div class='page-actions table-cell.toolbar'>
  <%= link_to "Add Notification", "/admin/notifications/new", :class => "button icon-plus create_btn", :id => "notification_add_btn"%>
</div>
<table class='index' id = 'index_table'>
  <thead>
    <tr>
      <th> Notification Message </th>
      <th> Start Date </th>
      <th> End Date </th>
    </tr>
  </thead>
  <tbody>
    <% @notifications.each do |notification| %>
      <tr>
        <td><%= notification.notification %></td>
        <td><%= notification.start_date.strftime('%Y-%m-%d %H:%M') %></td>
        <td><%= notification.end_date.strftime('%Y-%m-%d %H:%M') %></td>
        <td class='actions'>
          <%= link_to '', edit_admin_notification_path(notification), :class => "icon_link with-tip icon-edit no-text", :title => 'edit'%>
          <%= link_to '', "/admin/notifications/#{notification.id}", method: :delete, data: { confirm: 'Are you sure?' }, :class => "delete-resource icon_link with-tip icon-trash no-text", :title => 'delete'%>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
<%= paginate @notifications %>
